home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Dec 90 / MacApp.Tech$ 12⁄14⁄90 / 2478-Adding text to TEVie-Dec90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.7 KB  |  48 lines  |  [TEXT/GEOL]

  1. Item    8883801                         8-Dec-90        09:04
  2.  
  3. From:   MIKE.BLACKWELL@ROVER.RI.CMU.EDU@INTERNET# 
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. INTERNET# Document Id: <660693876/mkb@ROVER.RI.CMU.EDU>
  8.  
  9. ------------------------------------------------------------------------------
  10.  
  11. Sub:    Adding text to TEView
  12.  
  13. TO REPLY, use: Mike.Blackwell@ROVER.RI.CMU.EDU@INTERNET#
  14. Using the reply function in AppleLink does not work for gatewayed E-mail yet.
  15.  
  16. From: Mike.Blackwell@ROVER.RI.CMU.EDU
  17. To: macapp.tech$@applelink.apple.com
  18.  
  19. AppleLink reply to: mkb@rover.ri.cmu.edu@INTERNET#
  20.  
  21. I'm working on an application that requires a console window logging
  22. various text status messages generated externally. I thought I'd use a
  23. TEView, so I'd get cut/paste, printing and styles for free. (I tried
  24. TTranscriptView, but couldn't get it to do what I wanted short of
  25. re-writing it). My problem is appending a text message to the TEView:
  26.  
  27. pascal void TConsoleDocument::AddText(char *theText)
  28. {
  29.     int textLen;
  30.  
  31.     textLen = strlen(theText);
  32.     if ((fConsoleView->fMaxChars - GetHandleSize(fTextHandle)) < textLen) {
  33.         StdAlert(phTooManyChars);
  34.         return;
  35.     }
  36.     TEInsert(theText, textLen, fConsoleView->fHTE);
  37.     fConsoleView->RecalcText();
  38.     fConsoleView->SynchView(true);
  39. }
  40.  
  41. This works, but the display in the window gets screwed up when it
  42. reachs the bottom and needs to scroll - tops of lines get chopped off,
  43. and some lines don't show up at all. Forcing an update (say by covering
  44. then uncovering the window) fixes the drawing. Any ideas what I'm doing
  45. wrong here (or a better way to do it)?
  46.  
  47.                 thanks, Mike Blackwell          mkb@rover.ri.cmu.edu
  48.